/**
 * 道具:类型；存在时间；
 */
class Props extends Flyrole {
    //0：血包;1：弹药
    public type: number = 0;
    //消失时间
    public disappear_time: number;
    constructor(){
        super();
        this.hp = 1;
        this.speed = 1;
        this.camp = 1;
        this.radius = 1
    }
    public init():Props {
        super._init_();
        this.type = Math.random() < 0.6 ? 0 : 1;
        this.disappear_time = Laya.Browser.now() + 4600;
        this.playAciton('fly');
        return this;
    }

    public playAciton(_action: string):void {
        super.playAciton('props'+this.type, _action);
    }

    public rollbackSelf():void {
        super.rollbackSelf();
        this.removeSelf();
        Laya.Pool.recover('props', this);
    }

    public attacked():void {
        super.attacked();
        this.rollbackSelf();
    }
}